<template>
  <div class="discounts">
    <van-nav-bar title="兑换优惠" />
    <van-search
      v-model="value"
      placeholder="请输入兑换码"
      class="search"
      @input="BtnColor"
    />
    <div class="btn" ref="btn">
      <van-button round type="info" size="large" color="#6d87c4"
        >确定</van-button
      >
    </div>
  </div>
</template>

<script>
export default {
  methods: {
    BtnColor() {
      //   console.log(this.value);
      if (this.value != "") {
        this.$refs.btn.style.opacity = 1;
      } else {
        this.$refs.btn.style.opacity = 0.5;
      }
    },
    // BtnOp() {
    //   this.$refs.btn.style.opacity = 0.5;
    // },
  },
  data() {
    return {
      value: "",
    };
  },
};
</script>

<style scoped>
/deep/.van-field__left-icon .van-icon,
.van-field__right-icon {
  display: none;
}
.search {
  width: 80%;
  margin: 0.2rem auto;
}
.btn {
  width: 73%;
  margin: -0.1rem auto;
  opacity: 0.6;
}
</style>